1

00:00:01,160  -->  00:00:06,240
In the previous video, we create friends models
in our Django project.

2

00:00:06,500  -->  00:00:10,180
We also add some of our friends to the database.

3

00:00:10,560  -->  00:00:15,260
Now let’s display
all of our friends to the Django page.

4

00:00:15,520  -->  00:00:22,080
To doing that, we need to pass our friends
as a context from views.py to template file.

5

00:00:22,720  -->  00:00:27,120
Let’s go to visual studio code and open
views.py.

6

00:00:30,940  -->  00:00:34,680
First, we need to import Friends from models.

7

00:00:40,440  -->  00:00:45,960
Now we can get all of our friends from database
using script like this.

8

00:00:51,060  -->  00:00:55,520
Next, we need to pass all_friends variable as context.

9

00:01:01,300  -->  00:01:03,640
Now open the template file.

10

00:01:09,300  -->  00:01:14,320
Let’s print the list of our friends here, to print all of friends,

11

00:01:14,320  -->  00:01:19,860
we can use looping. To do looping
in template file, we need to use curly braces

12

00:01:19,860  -->  00:01:26,420
and percents tag like this. The script will
be, “for friend in all_friends”,

13

00:01:26,440  -->  00:01:43,460
all_friends is a context variable that we have defined
in the views.py file. To print the name, we

14

00:01:46,140  -->  00:01:49,920
To print the name, we can use friend.name

15

00:01:55,680  -->  00:01:59,480
and to print the age,
we can use friend.age.

16

00:02:03,940  -->  00:02:07,440
Let’s open the browser and look what happened.

17

00:02:17,580  -->  00:02:22,100
Cool !  Now we have the list of our friends here.

18

00:02:22,740  -->  00:02:29,760
This is the end of this video, also this is
the last video that cover about Django fundamentals.

19

00:02:30,080  -->  00:02:36,840
If you have any questions about Django fundamentals,
Fell free to ask me, I will do my best to

20

00:02:36,840  -->  00:02:38,940
answer all of your question.

21

00:02:39,300  -->  00:02:45,120
In the next video, we will start to build
our Web base network automation application.

22

00:02:45,620  -->  00:02:48,900
Thankyou for watching and see you on the next
video
